package com.jprocms.module.cms.convert.sysword;

import com.jpro.framework.common.pojo.PageResult;
import com.jprocms.module.cms.controller.admin.sysword.vo.*;
import com.jprocms.module.cms.dal.dataobject.sysword.SysWordDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 词汇管理 Convert
 *
 * @author jprocms
 */
@Mapper
public interface SysWordConvert {

    SysWordConvert INSTANCE = Mappers.getMapper(SysWordConvert.class);

    SysWordDO convert(SysWordCreateReqVO bean);

    SysWordDO convert(SysWordUpdateReqVO bean);

    SysWordDO convert(SysWordImportExcelVO bean);

    default SysWordDO convert2(SysWordImportExcelVO bean, String dictType) {
        SysWordDO sysWordDO = convert(bean);
        sysWordDO.setDictType(dictType);
        return sysWordDO;
    }

    SysWordRespVO convert(SysWordDO bean);

    List<SysWordRespVO> convertList(List<SysWordDO> list);

    PageResult<SysWordRespVO> convertPage(PageResult<SysWordDO> page);

    List<SysWordExcelVO> convertList02(List<SysWordDO> list);

}
